Page({

  /**
   * 页面的初始数据
   */
  data: {
    tabs: [
      {
        id: 0,
        value: "全部",
        isActive: true
      },
      {
        id: 1,
        value: "已完成",
        isActive: false
      },
      {
        id: 2,
        value: "未完成",
        isActive: false
      }

    ],
    goodsList:[]
  },




  //标题的点击事件，从自组件传递
  handleTabsItemChange(e) {
    //1、获取被点击的标题
    const { index } = e.detail
    //2、修改源数组
    let { tabs } = this.data;
    tabs.forEach((v, i) => i === index ? v.isActive = true : v.isActive = false)
    //3、赋值到data中
    this.setData({
      tabs
    })
  }
})